1. Field of the Invention
The invention relates to microcontrollers having registers associated with different resources contained therein and, more particularly, to a method for efficiently identifying and disclosing invalid register configurations in such systems.
2. Description of the Related Art
As microcontrollers become more and more complex, the number of resources that make up the microcontroller has grown. The increase in system resources, coupled with increasing processor clock speeds, has placed new burdens on system developers and complicated the task of debugging new systems. For each new resource contained within a microcontroller or other processor-oriented system, numerous resource registers may be maintained.
Many system resources require management of a large number of registers. For example, typical systems that support dynamic memory access, or DMA, are required to maintain many DMA registers. DMA command registers, DMA mode registers, DMA request registers, DMA mask registers, DMA address registers, and DMA page registers are usually included in a microcontroller.
Some microcontrollers are designed such that alternative configurations are available, enabling the user to tailor the microcontroller to its intended use. For example, the Elan SC400 microcontroller, a product of Advanced Micro Devices, of Sunnyvale, Calif., dedicates some microcontroller pins to either add DRAM address/bank control signals or add keyboard functions, but not both at the same time. A user who tries to enable both the expanded DRAM functionality and the additional keyboard functions may have difficulty discerning the problem.
Additionally, different resources within a microcontroller may be designed to share a signal bus. A user unfamiliar with the nuances of the programming requirements could improperly write to multiple devices. Again, such errors may be difficult to discover and correct.
Different resources within a microcontroller are often developed and maintained by different design teams, sometimes not even within the same company. This decentralization of design teams has not been well-suited to debugging of system resources. The need to provide support for developing and debugging a system is particularly acute within the embedded products industry, where specialized on-chip circuitry is often combined with a processor core.
System resources are typically debugged with only the resource itself in mind. When one resource is debugged, the other resources of the system are ignored. Because of the decentralization of resource development, consideration of conflicts between resources may not occur until late in the development process. Furthermore, the problem of identifying resource conflicts is exacerbated by the fact that system resource registers frequently are programmed dynamically. For software designers of complex microcontrollers, such issues present difficult challenges.
As a result of shrinking silicon process geometries, more circuitry may be added to an existing microcontroller design without increase in die size, manufacturing costs, or power dissipation. There is a growing trend for a portion of the additional capability to be used to monitor the integrated functions using built-in hardware. This gives hardware some knowledge of itself, and permits the hardware to have a greater role in self-management. The result is earlier problem determination at the system level, resulting in more robust overall product designs.
A microcontroller according to the present invention includes an invalid configuration detection resource. An invalid configuration detection resource permits systematic identification of conflicts between system resources during development of a particular resource within a system. The programmer/system designer of a particular resource can develop the resource without concern for other resources in the system.
In one embodiment, the invalid configuration detection resource approaches each resource, one by one. Once the resource is initialized, the invalid configuration detection resource, using either hardware, such as state machine of combinatorial logic, or firmware, checks xe2x80x9cexternalitiesxe2x80x9d of that resource, that is, registers outside the resource which cause conflicts for that resource. A resource-specific status register is then programmed with the results of the check.
After all resources are initialized and checked in a like manner, the invalid configuration detection resource, again using hardware or firmware, determines, based upon each resource status register value, whether the system contains an invalid configuration. A system status register is programmed with the results of this check.
A second embodiment of the invalid configuration detection resource also begins by focusing on each resource of the microcontroller separately. In this embodiment, following the configuration of each resource, the invalid configuration detection resource, using hardware or firmware, sets a resource-specific status register, based upon the configuration that occurred. For each possible configuration of the resource, a different value is programmed into the dedicated resource status register.
The invalid configuration detection resource then, using discrete hardware logic, such as state machine or combinatorial logic, or firmware, determines whether the system contains an invalid configuration, based upon the values contained in each resource status register. A system status register is then programmed with the results of this check.
In a third embodiment, the invalid configuration detection resource does not detect configuration conflicts based upon resources, but instead looks at selected system registers. Invalid combinations of two or more registers result in a bit being set in a system status register. Alternatively, the system status register may be programmed with a unique value for each invalid configuration found.
The invalid configuration detection resource further may contain one or more bit mask registers. A bit mask register allows certain resource or system status register values to trigger an interrupt. After the interrupt is polled by a processor of the microcontroller, the system debugger is informed by the bit mask register of which resource or system register caused the interrupt.
The invalid configuration detection resource includes reset logic that enables a user to reset the status registers. In this way, a user may initialize the invalid configuration detection resource for a new debug session after a configuration analysis is complete.
The invalid configuration detection resource may also contain latch logic so that, once an invalid configuration is detected, the associated status register will be latched to a predetermined value. This ensures that the invalid configuration is reflected in the invalid configuration detection resource and is only cleared upon reset by the user.
The invalid configuration detection resource may also include a software development port. This port permits dedicated access to the invalid configuration detection resource during debug of the system.
Thus, an invalid configuration detection resource permits a developer or debugger to systematically identify conflicts between two or more resources or, alternatively, between two or more registers in a microcontroller.